package course

import (
	"gitee.com/game_diamond/consts"
	"gitee.com/game_diamond/model/room"
	"qiniupkg.com/x/errors.v7"
)

func TeacherOpenCourse() error {
	teacherId, classId, courseId := 0, 0, 0
	roomId := room.MakeRoomId(teacherId, classId, courseId, consts.RoomTypeNormal)
	_, err := room.FindRoom(roomId)
	if err == nil {
		return errors.New("room has exist")
	}
	courseType := 0 //AI课

	switch courseType {
	case 0:
		ts := &room.TeacherExecutor{
			TeacherId: teacherId,
		}
		err := ts.CreateAIRoom(classId, courseId, consts.RoomTypeNormal)
		if err != nil {
			//fail
		}
	}

	//open success
	return nil
}
